- Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy path986. Interval List Intersections_test.go
45 lines (36 loc) · 984 Bytes
/
986. Interval List Intersections_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package leetcode
import (
"fmt"
"testing"
)
typequestion986struct {
para986
ans986
}
// para 是参数
// one 代表第一个参数
typepara986struct {
one []Interval
two []Interval
}
// ans 是答案
// one 代表第一个答案
typeans986struct {
one []Interval
}
funcTest_Problem986(t*testing.T) {
qs:= []question986{
{
para986{[]Interval{{Start: 0, End: 2}, {Start: 5, End: 10}, {Start: 13, End: 23}, {Start: 24, End: 25}},
[]Interval{{Start: 1, End: 5}, {Start: 8, End: 12}, {Start: 15, End: 24}, {Start: 25, End: 26}}},
ans986{[]Interval{{Start: 1, End: 2}, {Start: 5, End: 5}, {Start: 8, End: 10},
{Start: 15, End: 23}, {Start: 24, End: 24}, {Start: 25, End: 25}}},
},
}
fmt.Printf("------------------------Leetcode Problem 986------------------------\n")
for_, q:=rangeqs {
_, p:=q.ans986, q.para986
fmt.Printf("【input】:%v 【output】:%v\n", p, intervalIntersection(p.one, p.two))
}
fmt.Printf("\n\n\n")
}